<template>
  <div>
    <div class="toSearch">
      <div class="search" @click="toSearch">
        <i class="iconfont icon-search"></i>
        <input type="text" placeholder="请输入关键字" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  methods:{
    toSearch(){
      this.$router.push('/search')
    }
  }
};
</script>

<style scoped>
i {
  font-size: 0.4rem;
  color: black;
  /* position: absolute;
  top: 0.1rem; */
}
input {
  border: none;
  font-size: 0.3rem;
  height: 0.6rem;
  line-height: 0.6rem;
  margin-left: 0.4rem;
  outline: none;
  padding-top: 0.1rem;
}
.search {
  width: 80%;
  height: 0.8rem;
  line-height: 0.8rem;
  display: flex;
  border-radius: 0.1rem;
  background: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.toSearch {
  background: tomato;
  position: relative;
  height: 0.8rem;
}
</style>